<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>首页</title>
<style type="text/css">
*{
margin: 10px 5px 5px 5px;
}
.tipSpan{
	position: absolute;
	top:25%; 
	right: 15%;
	background-color: #F0F0F0;
	z-index:99999;
}
.login{
position: absolute;
top:26%; 
right: 5%;
width: 300px;
height: 300px;
text-align: center;
border: 1px solid black;
background-color: #F0F0F0;
}
.login1{
margin: 35px 5px 5px 5px;
}
img{
 width: 75%;
 height: auto;
}
label {
	width: 50px;
}
#erroTip{
color:red;
margin-top: 15px;
}
</style>
<%@include file="commonPage/heard.jsp" %>

<script type="text/javascript">
 $(function(){
	 $.idcode.setCode();
	
 });
 
 function validateForm(){
	 var flag = false;
	 var IsBy = $.idcode.validateCode(); 
	// alert(IsBy);
	 if(IsBy){
		 flag=true;
	 }else{
		 $("#erroTip").text("验证码错误");
	 }
	 if($("#userName").val().trim()==""){
		 $("#erroTip").text("用户名不能为空");
		 return flag;
	 }
	if($("#password").val().trim()==""){
		 $("#erroTip").text("密码不能为空");
		 return flag;
	 }
	 return flag;
 }
</script>
</head>

<body style="background-color: #F0F0F0;">
	<h2>
		<a href="https://www.oracle.com/index.html">WELCOME TO JAVAWEB</a>
	</h2>
		<span>当前在线人数${onLineCount}</span>
	<br>
	<hr>
	<img alt="goodpic" src="http://127.0.0.1:10086/hiServlet/img/1.jpg" />
	<span class="tipSpan">XXX管理系统</span>
	<div class="login">
		<div class="login1">
			<form action="InitServlet" onsubmit="return validateForm()" method="post">
				<input class="form-control" type="text" name="userName" id="userName" placeholder="请输入用户名"/><br>
				
				<input class="form-control" type="password" name="password" id="password" placeholder="请输入密码"/><br>
				
				<input class="form-control" type="text" id="Txtidcode" placeholder="请输入验证码"/><br><span  id="idcode"></span>
				
				<input type="submit" value="登录"  class="btn btn-default"/><br>
				<span id="erroTip">${errorTip}</span>
				<input type="hidden" name="_method" value="login"/>
			</form>
		</div>
	</div>
</body>
</html>